package com.topisv.tms.service.vo;

import java.math.BigDecimal;
import java.text.ParseException;

import com.topisv.tms.utils.TimeUtil;

public class RankList implements Comparable<RankList> {
	private String shippedBatch;//出库批次编号
	private String shippedTime;//出库批次时间
	
	private int orderNum; // 出库的订单数量

	public int getOrderNum() {
		return orderNum;
	}

	public void setOrderNum(int orderNum) {
		this.orderNum = orderNum;
	}

	public int getGoodsNum() {
		return goodsNum;
	}

	public void setGoodsNum(int goodsNum) {
		this.goodsNum = goodsNum;
	}

	public String getAreaGroupName() {
		return areaGroupName;
	}

	public void setAreaGroupName(String areaGroupName) {
		this.areaGroupName = areaGroupName;
	}

	public String getCustomerName() {
		return customerName;
	}

	public void setCustomerName(String customerName) {
		this.customerName = customerName;
	}

	private int goodsNum; // 出库的商品件数（不是SKU个数）

	private String areaGroupName; // 所属网点名称

	private String customerName;// 商家名称
	
	

	private String workNo;//流水批次编号
	
	private String startWorkTime;//流水批次起始时间
	private String endWorkTime;//流水批次结束时间
	private String realName;//操作人
	
	public String getRealName() {
		return realName;
	}

	public void setRealName(String realName) {
		this.realName = realName;
	}

	private String lineType;
	public String getLineType() {
		return lineType;
	}

	public void setLineType(String lineType) {
		this.lineType = lineType;
	}

	private String workType;//作业类型
	private int orderNumber;//订单数量
	private String startWorkTypeTime;//作业开始时间
	private String endWorkTypeTime;//作业结束时间
	
	public void setStartWorkTypeTime(String startWorkTypeTime) {
		this.startWorkTypeTime = startWorkTypeTime;
	}

	public void setEndWorkTypeTime(String endWorkTypeTime) {
		this.endWorkTypeTime = endWorkTypeTime;
	}

	private long time;
	public long getTime() {
		try {
			return (TimeUtil.getDateMMSS(getEndWorkTypeTime()).getTime()-TimeUtil.getDateMMSS(getStartWorkTypeTime()).getTime())/1000;
		} catch (ParseException e) {
		}
		return 0;
	}

	public String getStartWorkTypeTime() {
		return startWorkTypeTime;
	}

	public String getEndWorkTypeTime() {
		return endWorkTypeTime;
	}

	public void setTime(long time) {
		this.time = time;
	}

	private double averageTime;//每单处理的平均时间

	public String getShippedBatch() {
		return shippedBatch;
	}

	public void setShippedBatch(String shippedBatch) {
		this.shippedBatch = shippedBatch;
	}

	public String getShippedTime() {
		return shippedTime;
	}

	public void setShippedTime(String shippedTime) {
		this.shippedTime = shippedTime;
	}

	public String getWorkNo() {
		return workNo;
	}

	public void setWorkNo(String workNo) {
		this.workNo = workNo;
	}

	public String getStartWorkTime() {
		return startWorkTime;
	}

	public void setStartWorkTime(String startWorkTime) {
		this.startWorkTime = startWorkTime;
	}

	public String getEndWorkTime() {
		return endWorkTime;
	}

	public void setEndWorkTime(String endWorkTime) {
		this.endWorkTime = endWorkTime;
	}

	public String getWorkType() {
		return workType;
	}

	public void setWorkType(String workType) {
		this.workType = workType;
	}

	public int getOrderNumber() {
		return orderNumber;
	}

	public void setOrderNumber(int orderNumber) {
		this.orderNumber = orderNumber;
	}

	

	public double getAverageTime() {
		double f=(double)getTime()/orderNumber;
		BigDecimal b = new BigDecimal(f);
		return b.setScale(2,BigDecimal.ROUND_HALF_UP).doubleValue();
	}

	public void setAverageTime(double averageTime) {
		this.averageTime = averageTime;
	}

	@Override
	public int compareTo(RankList o) {
		// TODO Auto-generated method stub
		return o.getAverageTime()-this.getAverageTime()>0? -1:1;
	}

}
